import { Controller } from '@nestjs/common';
import { AuthService } from './auth.service';
import { ApiTags } from '@nestjs/swagger';
import { WxService } from '../wx/wx.service';


@ApiTags('权限')
@Controller('auth')
export default class AuthController {
  constructor(
    private readonly authService: AuthService,
    private readonly wxService: WxService,
  ) {
  }

  // @Post('login_by_Name')
  // async loginByName(@Body() payload: any): Promise<any> {
  //   console.log('######loginByName:', payload);
  //   const user = await this.authService.validateUserByName(payload);
  //   console.log('######user:', user);
  //   const accessToken = await this.authService.createToken(user);
  //   const openId = await this.wxService.code2Session(payload.loginCode);
  //   return {
  //     accessToken,
  //     openId,
  //   };
  // }

}

